import Vue from 'vue'
import Router from 'vue-router'

// const _import = require('./_import_' + process.env.NODE_ENV)
// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading

Vue.use(Router)

/* Layout */
import Layout from '../views/layout/Layout'

/**
* hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
*                                if not set alwaysShow, only more than one route under the children
*                                it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect           if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name'             the name is used by <keep-alive> (must set!!!)
* meta : {
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
  }
**/
export const constantRouterMap = [
  // {
  //   path: '/',
  //   component: Layout,
  //   redirect: '/login',
  //   name: 'login',
  //   hidden: true
  // },
  {
    path: '',
    component: Layout,
    redirect: '/dashboard/dashboard'
  },
  { path: '/login', component: () => import('@/views/login'), name: '登录大病理赔', hidden: true },
  { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true },
  { path: '/401', component: () => import('@/views/errorPage/401'), hidden: true },
  {
    path: '/law',
    component: Layout,
    redirect: 'protocolInsert',
    name: 'law',
    hidden: true,
    meta: {
      title: '案件管理'
    },
    children: [
      {
        path: 'register',
        name: 'register',
        component: () =>
          import ('@/views/law/register'),
        meta: { title: '案件登记' },
        hidden: true
      },
      {
        path: 'caseBatchClaim',
        name: 'caseBatchClaim',
        component: () =>
          import ('@/views/law/caseBatchClaim'),
        meta: { title: '批量理赔' },
        hidden: true
      },
      {
        path: 'caseDeal',
        name: 'caseDeal',
        component: () =>
          import ('@/views/law/caseDeal'),
        meta: { title: '案件处理' },
        hidden: true
      },
      {
        path: 'caseProcessDetail',
        name: 'caseProcessDetail',
        component: () =>
          import ('@/views/law/caseProcessDetail'),
        meta: { title: '案件详情' },
        hidden: true
      }
    ]

  },

  {
    path: '/survey',
    component: Layout,
    redirect: 'survey',
    name: 'survey',
    hidden: true,
    meta: {
      title: '调查管理'
    },
    children: [
      {
        path: 'surveyTaskApply',
        name: 'surveyTaskApply',
        component: () =>
          import ('@/views/survey/surveyTaskApply'),
        meta: { title: '调查任务申请' },
        hidden: true
      },
      {
        path: 'surveyTaskApplyDetail',
        name: 'surveyTaskApplyDetail',
        component: () =>
          import ('@/views/survey/surveyTaskApplyDetail'),
        meta: { title: '调查申请详情' },
        hidden: true
      },
      {
        path: 'surveyTaskList',
        name: 'surveyTaskList',
        component: () =>
          import ('@/views/survey/surveyTaskList'),
        meta: { title: '调查任务处理' },
        hidden: true
      },
      {
        path: 'surveyTaskListDetail',
        name: 'surveyTaskListDetail',
        component: () =>
          import ('@/views/survey/surveyTaskListDetail'),
        meta: { title: '调查任务详情' },
        hidden: true
      },
      {
        path: 'surveyTaskListDetailSee',
        name: 'surveyTaskListDetailSee',
        component: () =>
          import ('@/views/survey/surveyTaskListDetailSee'),
        meta: { title: '调查任务详情' },
        hidden: true
      },
      {
        path: 'surveyTaskAudit',
        name: 'surveyTaskAudit',
        component: () =>
          import ('@/views/survey/surveyTaskAudit'),
        meta: { title: '调查任务审核' },
        hidden: true
      },
      {
        path: 'surveyTaskAuditDetail',
        name: 'surveyTaskAuditDetail',
        component: () =>
          import ('@/views/survey/surveyTaskAuditDetail'),
        meta: { title: '调查审核详情' },
        hidden: true
      },
      {
        path: 'surveyTaskHistoryDetail',
        name: 'surveyTaskHistoryDetail',
        component: () =>
          import ('@/views/survey/surveyTaskHistoryDetail'),
        meta: { title: '调查历史轨迹' },
        hidden: true
      }
    ]

  },

  {
    path: '/cannel',
    component: Layout,
    redirect: 'cannel',
    name: 'cannel',
    hidden: true,
    meta: {
      title: '注销管理'
    },
    children: [

      {
        path: 'caseCancel',
        name: 'caseCancel',
        component: () =>
          import ('@/views/cannel/caseCancel'),
        meta: { title: '注销任务申请' },
        hidden: true
      },
      {
        path: 'caseCancelDetail',
        name: 'caseCancelDetail',
        component: () =>
          import ('@/views/cannel/caseCancelDetail'),
        meta: { title: '注销申请详情' },
        hidden: true
      },
      {
        path: 'caseCancelDetailSee',
        name: 'caseCancelDetailSee',
        component: () =>
          import ('@/views/cannel/caseCancelDetailSee'),
        meta: { title: '注销申请详情' },
        hidden: true
      },
      {
        path: 'caseCancelAudit',
        name: 'caseCancelAudit',
        component: () =>
          import ('@/views/cannel/caseCancelAudit'),
        meta: { title: '注销任务审核' },
        hidden: true
      },
      {
        path: 'caseCancelAuditDetail',
        name: 'caseCancelAuditDetail',
        component: () =>
          import ('@/views/cannel/caseCancelAuditDetail'),
        meta: { title: '注销审核详情' },
        hidden: true
      },
    ]

  },

  {
    path: '/caseManage',
    component: Layout,
    redirect: 'caseManage',
    name: 'caseManage',
    hidden: true,
    meta: {
      title: '核赔管理'
    },
    children: [

      {
        path: 'caseClaimTask',
        name: 'caseClaimTask',
        component: () =>
          import ('@/views/caseManage/caseClaimTask'),
        meta: { title: '核赔任务处理' },
        hidden: true
      },
      {
        path: 'caseClaimTaskAudit',
        name: 'caseClaimTaskAudit',
        component: () =>
          import ('@/views/caseManage/caseClaimTaskAudit'),
        meta: { title: '核赔任务处理' },
        hidden: true
      }
    ]

  },

  {
    path: '/settlement',
    component: Layout,
    redirect: 'settlement',
    name: 'settlement',
    hidden: true,
    meta: {
      title: '结算管理'
    },
    children: [
      {
        path: 'settlementTask',
        name: 'settlementTask',
        component: () =>
          import ('@/views/settlement/settlementTask'),
        meta: { title: '结算申请' },
        hidden: true
      },
      {
        path: 'settlementTaskDetail',
        name: 'settlementTaskDetail',
        component: () =>
          import ('@/views/settlement/settlementTaskDetail'),
        meta: { title: '结算处理' },
        hidden: true
      },
      {
        path: 'settlementTaskList',
        name: 'settlementTaskList',
        component: () =>
          import ('@/views/settlement/settlementTaskList'),
        meta: { title: '结算查询' },
        hidden: true
      },
      {
        path: 'settlementTaskListDetail',
        name: 'settlementTaskListDetail',
        component: () =>
          import ('@/views/settlement/settlementTaskListDetail'),
        meta: { title: '结算详情' },
        hidden: true
      },
      {
        path: 'settlementTaskAudit',
        name: 'settlementTaskAudit',
        component: () =>
          import ('@/views/settlement/settlementTaskAudit'),
        meta: { title: '结算审核' },
        hidden: true
      }
      ,
      {
        path: 'settlementTaskAuditDetail',
        name: 'settlementTaskAuditDetail',
        component: () =>
          import ('@/views/settlement/settlementTaskAuditDetail'),
        meta: { title: '结算审核处理' },
        hidden: true
      },
      {
        path: 'Deduction',
        name: 'Deduction',
        component: () =>
          import ('@/views/settlement/Deduction'),
        meta: { title: '结算扣款申诉' },
        hidden: true
      },
      {
        path: 'DeductionAppeal',
        name: 'DeductionAppeal',
        component: () =>
          import ('@/views/settlement/DeductionAppeal'),
        meta: { title: '结算扣款审核' },
        hidden: true
      },
      {
        path: 'DeductionList',
        name: 'DeductionList',
        component: () =>
          import ('@/views/settlement/DeductionList'),
        meta: { title: '申诉申请' },
        hidden: true
      },
      {
        path: 'DeductionAppealList',
        name: 'DeductionAppealList',
        component: () =>
          import ('@/views/settlement/DeductionAppealList'),
        meta: { title: '申诉审核' },
        hidden: true
      }
    ]

  },

  {
    path: '/ticketDeal',
    component: Layout,
    redirect: 'ticketDeal',
    name: 'ticketDeal',
    hidden: true,
    meta: {
      title: '退票管理'
    },
    children: [
      {
        path: 'refundTicket',
        name: 'refundTicket',
        component: () =>
          import ('@/views/ticketDeal/refundTicket'),
        meta: { title: '退票处理' },
        hidden: true
      },
      {
        path: 'refundTicketDetail',
        name: 'refundTicketDetail',
        component: () =>
          import ('@/views/ticketDeal/refundTicketDetail'),
        meta: { title: '退票详情' },
        hidden: true
      },
      {
        path: 'refundTicketDetailSee',
        name: 'refundTicketDetailSee',
        component: () =>
          import ('@/views/ticketDeal/refundTicketDetailSee'),
        meta: { title: '退票详情' },
        hidden: true
      },
      {
        path: 'refundTicketAudit',
        name: 'refundTicketAudit',
        component: () =>
          import ('@/views/ticketDeal/refundTicketAudit'),
        meta: { title: '退票审核' },
        hidden: true
      },
      {
        path: 'refundTicketAuditDetail',
        name: 'refundTicketAuditDetail',
        component: () =>
          import ('@/views/ticketDeal/refundTicketAuditDetail'),
        meta: { title: '退票审核详情' },
        hidden: true
      }
    ]

  },




  {
    path: '/caseReopenManage',
    component: Layout,
    redirect: 'caseReopenManage',
    name: 'caseReopenManage',
    hidden: true,
    meta: {
      title: '重开管理'
    },
    children: [

      {
        path: 'caseReopen',
        name: 'caseReopen',
        component: () =>
          import ('@/views/caseReopenManage/caseReopen'),
        meta: { title: '重开赔案申请' },
        hidden: true
      },
      {
        path: 'caseReopenDemo',
        name: 'caseReopenDemo',
        component: () =>
          import ('@/views/caseReopenManage/caseReopenDemo'),
        meta: { title: '重开申请' },
        hidden: true
      },
      {
        path: 'caseReopenAudit',
        name: 'caseReopenAudit',
        component: () =>
          import ('@/views/caseReopenManage/caseReopenAudit'),
        meta: { title: '重开赔案审核' },
        hidden: true
      },
      {
        path: 'caseReopenAuditDemo',
        name: 'caseReopenAuditDemo',
        component: () =>
          import ('@/views/caseReopenManage/caseReopenAuditDemo'),
        meta: { title: '重开审核' },
        hidden: true
      },
      {
        path: 'caseReopenProcess',
        name: 'caseReopenProcess',
        component: () =>
          import ('@/views/caseReopenManage/caseReopenProcess'),
        meta: { title: '重开赔案处理' },
        hidden: true
      }
    ]

  },
  {
    path: '/printManage',
    component: Layout,
    redirect: 'printManage',
    name: 'printManage',
    hidden: true,
    meta: {
      title: '打印管理'
    },
    children: [
      {
        path: 'printSettlement',
        name: 'printSettlement',
        component: () =>
          import ('@/views/printManage/printSettlement'),
        meta: { title: '结算单打印' },
        hidden: true
      }
    ]

  },
  {
    path: '/helper',
    component: Layout,
    redirect: 'helper',
    name: 'helper',
    hidden: true,
    meta: {
      title: '辅助功能'
    },
    children: [
      {
        path: 'accountInfo',
        name: 'accountInfo',
        component: () =>
          import ('@/views/helper/accountInfo'),
        meta: { title: '领款人维护' },
        hidden: true
      },
      {
        path: 'accountInfoDemo',
        name: 'accountInfoDemo',
        component: () =>
          import ('@/views/helper/accountInfoDemo'),
        meta: { title: '账户信息' },
        hidden: true
      },
      {
        path: 'accountInfoSee',
        name: 'accountInfoSee',
        component: () =>
          import ('@/views/helper/accountInfoSee'),
        meta: { title: '账户信息' },
        hidden: true
      },
      {
        path: 'taskReassignment',
        name: 'taskReassignment',
        component: () =>
          import ('@/views/helper/taskReassignment'),
        meta: { title: '任务改派' },
        hidden: true
      }

    ]

  },

  {
    path: '/basiceinfo',
    component: Layout,
    redirect: 'basiceinfo',
    name: 'basiceinfo',
    hidden: true,
    meta: {
      title: '基础信息管理'
    },
    children: [
      {
        path: 'drugCatalog',
        name: 'drugCatalog',
        component: () =>
          import ('@/views/basiceinfo/drugCatalog'),
        meta: { title: '药品目录管理' },
        hidden: true
      },
      {
        path: 'drugCatalogDemo',
        name: 'drugCatalogDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/drugCatalogDemo'),
        meta: { title: '药品目录管理' },
        hidden: true
      },
      {
        path: 'treatProjectCatalog',
        name: 'treatProjectCatalog',
        component: () =>
          import ('@/views/basiceinfo/treatProjectCatalog'),
        meta: { title: '治疗项目目录管理' },
        hidden: true
      },
      {
        path: 'treatProjectCatalogDemo',
        name: 'treatProjectCatalogDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/treatProjectCatalogDemo'),
        meta: { title: '治疗项目目录管理' },
        hidden: true
      },
      {
        path: 'ailmentCatalog',
        name: 'ailmentCatalog',
        component: () =>
          import ('@/views/basiceinfo/ailmentCatalog'),
        meta: { title: '疾病目录管理' },
        hidden: true
      },
      {
        path: 'ailmentCatalogDemo',
        name: 'ailmentCatalogDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/ailmentCatalogDemo'),
        meta: { title: '疾病目录管理' },
        hidden: true
      },
      {
        path: 'serveFacilityCatalog',
        name: 'serveFacilityCatalog',
        component: () =>
          import ('@/views/basiceinfo/serveFacilityCatalog'),
        meta: { title: '服务设施目录管理' },
        hidden: true
      },
      {
        path: 'serveFacilityCatalogDemo',
        name: 'serveFacilityCatalogDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/serveFacilityCatalogDemo'),
        meta: { title: '服务设施目录管理' },
        hidden: true
      },
      {
        path: 'yearCostMaintain',
        name: 'yearCostMaintain',
        component: () =>
          import ('@/views/basiceinfo/yearCostMaintain'),
        meta: { title: '年度费用累计维护' },
        hidden: true
      },
      {
        path: 'yearCostMaintainDemo',
        name: 'yearCostMaintainDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/yearCostMaintainDemo'),
        meta: { title: '年度费用累计维护' },
        hidden: true
      },
      {
        path: 'medicalInstitutionMessage',
        name: 'medicalInstitutionMessage',
        component: () =>
          import ('@/views/basiceinfo/medicalInstitutionMessage'),
        meta: { title: '医疗机构信息管理' },
        hidden: true
      },
      {
        path: 'medicalInstitutionMessageDemo',
        name: 'medicalInstitutionMessageDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/medicalInstitutionMessageDemo'),
        meta: { title: '医疗机构信息管理' },
        hidden: true
      },
      {
        path: 'healthInstitutionMessage',
        name: 'healthInstitutionMessage',
        component: () =>
          import ('@/views/basiceinfo/healthInstitutionMessage'),
        meta: { title: '医保机构信息管理' },
        hidden: true
      },
      {
        path: 'healthInstitutionMessageDemo',
        name: 'healthInstitutionMessageDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/healthInstitutionMessageDemo'),
        meta: { title: '医保机构信息管理' },
        hidden: true
      },
      {
        path: 'handleInstitutionWhole',
        name: 'handleInstitutionWhole',
        component: () =>
          import ('@/views/basiceinfo/handleInstitutionWhole'),
        meta: { title: '经办机构统筹区管理' },
        hidden: true
      },
      {
        path: 'handleInstitutionWholeDemo',
        name: 'handleInstitutionWholeDemo',
        component: () =>
          import ('@/views/basiceinfo/newDocument/handleInstitutionWholeDemo'),
        meta: { title: '经办机构统筹区管理' },
        hidden: true
      }
    ]

  },
  {
    path: '/report',
    component: Layout,
    redirect: 'report',
    name: 'report',
    hidden: true,
    meta: {
      title: '统计分析'
    },
    children: [
      {
        path: 'caseReport',
        name: 'caseReport',
        component: () =>
          import ('@/views/report/caseReport'),
        meta: { title: '案件清单' },
        hidden: true
      }
    ]

  },
  {
    path: '/caseResearch',
    component: Layout,
    redirect: 'caseResearch',
    name: 'caseResearch',
    hidden: true,
    meta: {
      title: '案件查询'
    },
    children: [
      {
        path: 'caseInfo',
        name: 'caseInfo',
        component: () =>
          import ('@/views/caseResearch/caseInfo'),
        meta: { title: '案件查询' },
        hidden: true
      }
    ]

  },



  //案件登记详情页
  {
    path: '/law/caseProcessDetail',
    component: () =>
      import ('@/views/law/caseProcessDetail'),
    hidden: true
  },
  //案件查询
  {
    path: '/law/register',
    component: () =>
      import ('@/views/law/register'),
    hidden: true
  },
  // //忘记密码
  // {
  //   path: '/resetPwd',
  //   name: 'resetPwd',
  //   component: () =>
  //     import ('@/views/forgetPwd/index'),
  //   hidden: true
  // },
  {
    path: '/login',
    name: 'login',
    component: () =>
      import ('@/views/login'),
    hidden: true
  },
  //理赔查询
  {
    path: '/claimapplication',
    component: Layout,
    redirect: 'claimapplication',
    name: 'claimapplication',
    hidden: true,
    meta: {
      title: '理赔查询'
    },
    children: [
      {
        path: 'claimentry',
        name: 'claimentry',
        component: () =>
          import ('@/views/claimapplication/claimentry'),
        meta: { title: '理赔申请录入' },
        hidden: false
      }
    ]
  },

  // 锁屏
  {
    path: '/lock',
    hidden: true,
    name: '锁屏页',
    component: () => import('@/views/common/lock')
  },

  {
    path: '/dashboard',
    component: Layout,
    meta: { title: 'dashboard', icon: 'dashboard' },
    children: [
      {
        path: 'dashboard',
        name: 'dashboard',
        component: () => import('@/views/dashboard/dashboard'),
        meta: { title: 'dashboard', icon: 'dashboard' }
      }
    ]
  },
  // 图标组件
  {
    path: '/icons',
    component: Layout,
    redirect: '/icons/iconIndex',
    name: 'icons',
    meta: {
      title: 'Icons',
      icon: 'icon'
    },
    children: [
      {
        path: 'iconIndex',
        name: 'iconIndex',
        component: () => import('@/views/icons/svg-icons/iconIndex'),
        meta: { title: 'svgicons', icon: 'icon' }
      },
      {
        path: 'font-awesome',
        name: 'font-awesome',
        component: () => import('@/views/icons/font-awesome/'),
        meta: { title: 'fontawesome', icon: 'font-awesome' }
      },
      {
        path: 'AliIcons',
        name: 'AliIcons',
        component: () => import('@/views/icons/AliIcons/'),
        meta: { title: 'AliIcons', icon: 'AliIcons' }
      }
    ]
  }
]

export default new Router({
  // mode: 'history', //后端支持可开
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
export const asyncRouterMap = []
